﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace MVPSPIKE
{
    public class Counter : ICounter
    {
        public int CValue { get; set; }
        public event NumberChangedEventHandler NumberChanged = null;
        public Counter()
        {
            CValue = 0;
        }
        public void increment()
        {
            CValue++;

            IntEventArgs e = new IntEventArgs(CValue);

            OnValueChange(e);
        }

        protected virtual void OnValueChange(IntEventArgs e)
        {

            if (this.NumberChanged != null)
            {
                this.NumberChanged(this, e);
            }


        }


    }
}
